

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class HelloWorld extends HttpServlet {
	private String message;

	// 初始化
	// 初始化会在页面第一次被访问到的时候，初始化。
	@Override
	public void init() throws ServletException {
		message = "hello world";
		System.out.println(message);
		super.init();
	}

	// get方法
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		super.doGet(req, resp);
	}

	//post方法
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		super.doPost(req, resp);
	}

	// delete方法
	@Override
	protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		super.doDelete(req, resp);
	}

	/**
	 * 销毁
	 */
	@Override
	public void destroy() {
		super.destroy();
	}
}
